package com.kk.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class InfoCollege implements College {

    private List<Department> departmentList;

    public InfoCollege() {
        departmentList = new ArrayList<>();
        addDepartment("信息安全专业", "信息");
        addDepartment("网络安全专业", "网络");
        addDepartment("服务器安全专业", "服务器");
    }

    @Override
    public String getName() {
        return "信息学院";
    }

    @Override
    public void addDepartment(String name, String des) {
        Department department = new Department(name, des);
        departmentList.add(department);
    }

    @Override
    public Iterator createIerator() {
        return new InfoCollegeIterator(departmentList);
    }
}
